<template>
  <div class="container">
    <titleTop :titleTxet="titleTxet"></titleTop>
    <textarea class="signature font_30 c_28" v-model="signature" maxlength="30" placeholder="输入签名，限制30字。"></textarea>
    <div class="m_t30 font_28 c_8c">
      <span>一个好的签名，更能让人记住。</span><br>
      <span class="span">友情提示最多30个字,当前{{nums}}</span>
    </div>
    <div class="sub-btn t_center font_36 c_ff">
        <span @click="finis()">完成</span>
    </div>
  </div>
</template>
<script>
  import {Dialog} from 'vant';
import titleTop from "../../com/title";
import * as common from "../../../api/common.js";
export default {
  components: { titleTop },
  data() {
    return {
      titleTxet: {
        titleName: "更改签名",
        IsBool: true,
        IsShare: false
      },
      signature:this.$store.state.singist,
    };
  },
  computed:{
    nums(){
      return this.signature.length;
    }
  },
  mounted(){
    mui.back = function() {
      window.history.go(-1);
    }
  },
  methods:{
    finis(){
      let parms = {
        user_id:this.$store.state.user_id,
        signature:this.signature
      };
      common.change_userinfo(parms).then(res=>{
        console.log(res);
        if (res.status==200) {
          Dialog.alert({
            message: res.msg
          });
          history.go(-1);
        }
      })
    }
  }
};
</script>
<style scoped>
.signature{
    display: block;
    /* width: 670px; */
    width: 100%;
    height: 360px;
    padding: 30px;
    box-sizing: border-box;
    margin-top: 100px;
  border: 2px solid #dcdcdc;
}
.sub-btn {
  width: 400px;
  height: 80px;
  line-height: 80px;
  margin: 0 auto;
  background: #884ca4;
  border-radius: 10px;
  margin-top: 360px;
}
.sub-btn span{
  color: #fff;
}
  .span{
    display: inline-block;
    margin-top: 40px;
    color: #f00;
  }
</style>


